<template>
  <div class="home_body">
      <div class="home_nav_box" :style="{height:navHeight+'px'}">
        <div class="home_nav_item">
        </div>
        <div class="home_nav_item">
            <!-- <text class="home_title">首页</text> -->
        </div> 
        <div class="home_nav_item home_flexend">
            <image class="home_nav_img" :src="img_more"></image>
        </div>   
      </div>
      <div class="home_content" :style="{height:contentHeight+'px'}">
        <div class="home_content_date" :style="{height:dateHeight+'px'}">
            <text class="home_content_time_text">{{currentTime}}</text>
            <text class="home_content_date_text">{{currentDate}}</text>
        </div>
        <div class="home_content_item">
            
        </div>
      </div>
  </div>
</template>

<style scoped>
.home_body{
    background-color: brown;
}
.home_nav_box{
    width: 750px;
    margin-top: 0px;
    justify-content: center;
    align-items: center;
    background-color: red;
    flex-direction: row;
}

.home_content{
    width: 750px;
    background-color: wheat;
}
.home_nav_item{
    flex: 1;
    justify-content: center;
    align-items: center;
}
.home_title{
    font-size: 26px;
    color: white;
}
.home_flexend{
    align-items: flex-end;
}
.home_nav_img{
    width: 35px;
    height: 35px;
    margin-right: 20px;
}
.home_content_date{
    width: 750px;
    background-color: #f0f;
    /*justify-content: center;*/
}
.home_content_time_text{
    text-align: center;
    font-size: 96px;
    color: black;
}
.home_content_date_text{
    text-align: center;
    font-size: 24px;
    color: gray;
}
</style>

<script>
var self;
export default {
    // 动态数据属性
    data: function(){
      return{
          img_more:"",
          navHeight:0,
          contentHeight:0,
          currentTime:"",
          currentDate:"",
          dateHeight:0
      }
    },
     //组件头文件导入
    components: {
        
    },
    //组件实例创建完成，属性已绑定，但DOM还未生成
    created() {
        self = this;

        self.img_more = self.gImageUrl + 'moreclass.png';
        self.navHeight = 40;
        var screenHeight = 0;
        var screenWidth = 0;
        screenHeight = weex.config.env.deviceHeight;
        screenWidth = weex.config.env.deviceWidth;
        screenHeight = screenHeight / (screenWidth / 750.0)


        console.log('高度-->'+screenHeight);
        console.log('宽度-->'+screenWidth);
        self.contentHeight = screenHeight-self.navHeight;
        console.log('contentHeight-->'+self.contentHeight);
        self.dateHeight = self.contentHeight/2;
        // self.contentHeight = 380;

        // 设置时间
        self.setData();

    },
    //方法，函数
    methods: {
        choiseServer:function(e){
            console.log("choiseServer");
        },
        setData: function(){// 获取时间
            var myDate = new Date();
            self.currentTime = myDate.getHours() + ':' + myDate.getMinutes();
            var currentDate = myDate.getFullYear() + '年' + myDate.getMonth() + '月' + myDate.getDate() + '日';

            var myddy=myDate.getDay();//获取存储当前日期
            var weekday=["星期日","星期一","星期二","星期三","星期四","星期五","星期六"];
            self.currentDate = currentDate + '  ' + weekday[myddy];
        }
        
    }
}
</script>

